#ifndef YCCOREUSEROPENINFO_H
#define YCCOREUSEROPENINFO_H
#include <QJsonObject>
#include <QString>

namespace yc {

class UserOpenInfo
{
public:
    enum Status {
        NONE_STATUS = 0,
        DISABLED_STATUS = 1,
        LOCKED_STATUS = 2,
        ACCOUNT_EXPIRED_STATUS = 4,
        PASSWORD_EXPIRED_STATUS = 8
    };

    enum ChangeStatus { MODIFIED_STATUS = 1, APPROVED_STATUS = 2, REJECTED_STATUS = 4 };

    UserOpenInfo() { }
    UserOpenInfo(int id, const QString& name) : id_(id), name_(name) { }
    explicit UserOpenInfo(const QJsonObject& jo) { updateData(jo); }

    int id() const { return id_; }
    void setId(int id) { id_ = id; }
    const QString& name() const { return name_; }
    void setName(const QString& name) { name_ = name; }
    const QString& nickname() const { return nickname_; }
    void setNickname(const QString& nickname) { nickname_ = nickname; }
    int gender() const { return gender_; }
    void setGender(int gender) { gender_ = gender; }
    const QString& avatar() const { return avatar_; }
    void setAvatar(const QString& avatar) { avatar_ = avatar; }
    const QString& address() const { return address_; }
    void setAddress(const QString& address) { address_ = address; }
    const QString& profile() const { return profile_; }
    void setProfile(const QString& profile) { profile_ = profile; }
    const QString& cover() const { return cover_; }
    void setCover(const QString& cover) { cover_ = cover; }
    int status() const { return status_; }
    void setStatus(int status) { status_ = status; }

    void updateData(const QJsonObject& jo);

private:
    int id_ = 0;
    QString name_;
    QString nickname_;
    int gender_ = 0;
    QString avatar_;
    QString address_;
    QString profile_;
    QString cover_;
    int status_ = NONE_STATUS;
};

} // namespace yc

#endif // YCCOREUSEROPENINFO_H
